<?php
class ControllerModuleNews extends Controller {
	protected function index($setting) {
		$this->language->load('module/news');
		
		$this->data['news_title']    = $this->language->get('news_title');
		$this->data['whether_title'] = $this->language->get('whether_title');
		$this->data['webcam_title']  = $this->language->get('webcam_title');
		
		$this->data['borovets']  = $this->language->get('borovets');
		$this->data['bansko']  = $this->language->get('bansko');
		$this->data['pamporovo']  = $this->language->get('pamporovo');
		$this->data['vitosha']  = $this->language->get('vitosha');
		
		$this->data['min']  = $this->language->get('min');
		$this->data['max']  = $this->language->get('max');
		$this->data['wind']  = $this->language->get('wind');
		
		$this->data['meteo_station']  = $this->language->get('meteo_station');
		
		$this->data['city']  = array('Borovets, Bulagaria','Bansko, Bulagaria','Vitosha, Bulagaria','Pamporovo, Bulagaria'); 
		
		$this->load->model('catalog/information');		
		
		

		$results = $this->model_catalog_information->getNews(5)	;

		foreach ($results as $result) {			
			
			
			$this->data['news'][] = array(
				
				
				'name'    	 => $result['title'],
				'description'  => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
				'href'    	 => $this->url->link('information/information', 'information_id=' . $result['information_id']),
			);
		}

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/news.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/module/news.tpl';
		} else {
			$this->template = 'default/template/module/news.tpl';
		}

		$this->render();
	}
}
?>